package com.leizi.igym.utils;

import com.leizi.igym.domain.User;
import com.leizi.igym.pojo.ContextUser;
import org.springframework.beans.BeanUtils;

import java.util.Objects;

/**
 * @Author: leizi0110
 * @CreateTime: 2024-04-02  21:59
 * @Description:
 */

public class ContextUtils {

    public static ContextUser toContextUser(User user){
        if (Objects.isNull(user)){
            return null;
        }
        ContextUser contextUser = new ContextUser();
        BeanUtils.copyProperties(user,contextUser);
        return contextUser;
    }
}
